package com.legal.domain.po;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>用户刷题统计表</p>
 *
 * @author xiaopeng
 * @since 2025-06-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_user_practice_stats")
@Schema(name = "UserPracticeStats", description = "用户刷题统计表")
public class UserPracticeStats implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "自增主键", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "用户编号", example = "U10001")
    private String userNo;

    @Schema(description = "题库分类编号", example = "CAT_JAVA_BASIC")
    private String categoryNo;

    @Schema(description = "总刷题次数", example = "15")
    private Integer totalPractices;

    @Schema(description = "总答题数", example = "300")
    private Integer totalQuestions;

    @Schema(description = "总正确数", example = "240")
    private Integer correctCount;

    @Schema(description = "最高得分", example = "98.5")
    private BigDecimal highestScore;

    @Schema(description = "平均得分", example = "85.2")
    private BigDecimal averageScore;

    @Schema(description = "最后刷题时间", example = "2025-06-27")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime lastPracticeTime;

    @Schema(description = "更新时间", example = "2025-06-27")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime updateTime;
}
